package GUILayer;

import java.awt.BorderLayout;
import java.awt.EventQueue;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;
import javax.swing.JSeparator;

public class MainWindow
{
	public int roles = 00000;  /* determines user's roles     */
    							/* 00001 = Parent              */
                                /* 00010 = Trainer             */
                                /* 00100 = Supervisor          */
                                /* 01000 = Administrator       */
                                /* 10000 = Super Administrator */
	
	private JFrame frmPareManagement;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					MainWindow window = new MainWindow();
					window.frmPareManagement.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the application.
	 */
	public MainWindow() {
		initialize();
	}

	/**
	 * Initialize the contents of the frame.
	 */
	private void initialize() {
		frmPareManagement = new JFrame();
		frmPareManagement.setTitle("PareManagement");
		frmPareManagement.setBounds(100, 100, 1000, 600);
		frmPareManagement.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

		
		JPanel panelTapPan = new JPanel();
		frmPareManagement.getContentPane().add(panelTapPan, BorderLayout.CENTER);
		panelTapPan.setLayout(new BorderLayout(0, 0));
		
		JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
		panelTapPan.add(tabbedPane);
		
		JPanel panelLogin = new PanelLogin();
		tabbedPane.addTab("Login", null, panelLogin, null);
		
		if (roles == 00001)
		{
			JPanel panelCalendar = new PanelCalendar();
			tabbedPane.addTab("Kalender", null, panelCalendar, null);
		
			JPanel panelTraining = new PanelTraining();
			tabbedPane.addTab("Træning", null, panelTraining, null);
		
			JPanel panelSupervisor = new PanelSupervisor();
			tabbedPane.addTab("Supervisor", null, panelSupervisor, null);
		
			JPanel panelAdmin = new PanelAdmin();
			tabbedPane.addTab("Administration", null, panelAdmin, null);
		}

	}
	
}
